package com.mccraywebtech.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.mccraywebtech.dao.GenericDAO;
import com.mccraywebtech.models.User;
import com.mccraywebtech.services.GenericService;


@Service("loginService")
public class LoginServiceImpl implements GenericService<User> {
	@Autowired
	@Qualifier("userMockDAO")
	private GenericDAO<User> userDAO;

	public GenericDAO<User> getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(GenericDAO<User> userDAO) {
		this.userDAO = userDAO;
	}

	@Override
	public void saveObject(User c) {
		// TODO Auto-generated method stub
		this.getUserDAO().saveObject(c);
	}

	@Override
	public void updateObject(User c) {
		// TODO Auto-generated method stub
		this.getUserDAO().updateObject(c);
	}

	@Override
	public void deleteObject(int id) {
		// TODO Auto-generated method stub
		this.getUserDAO().deleteObject(id);
	}

	@Override
	public User getObject(int id) {
		// TODO Auto-generated method stub
		return (User) this.getUserDAO().getObject(id);
	}

	@Override
	public User getByUsername(String username) {
		// TODO Auto-generated method stub
		return (User) this.getUserDAO().getByUsername(username);
	}

	@Override
	public List<User> getAllObjects() {
		// TODO Auto-generated method stub
		return this.getUserDAO().getAllObjects();
	}

}
